<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <pre>
     1.键盘添加件常用的有 enter 和delete 在点击事件后面加@click.enter


    </pre>
    <div class="app">
       <input type="text" v-model="val" v-on:keyup.enter="handel">
       <input type="text" v-model="pwd" v-on:keyup.delete="empty">
    </div>
    <script type="text/javascript" src="./js/vue.js"></script>
    <script type="text/javascript">
    var xm = new Vue({
        el: '.app',
        data: {
         val: '',
         pwd: ''
        },
        methods: {
            handel () {
                console.log(this.val)
            },
            empty () {
                this.pwd = ''
            }
        }
    })
    
    
    
    </script>
</body>
</html>